//
//  HCMineAnswerTableViewCell.m
//  HappyChildren
//
//  Created by WillyZhao on 2017/1/18.
//  Copyright © 2017年 WillyZhao. All rights reserved.
//

#import "HCMineAnswerTableViewCell.h"

#import "HCMineAnswerdModel.h"

@implementation HCMineAnswerTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.lineUp.backgroundColor = YBKRGBCOLOR(242, 242, 242, 1);
    self.lineDown.backgroundColor = YBKRGBCOLOR(242, 242, 242, 1);
    
    self.textBg.backgroundColor = YBKRGBCOLOR(232, 232, 232, 1);
    self.bottombg.backgroundColor = YBKRGBCOLOR(242, 242, 242, 1);
    
    self.textBg.layer.cornerRadius = 5.0f;
    self.bgView.layer.cornerRadius = 5.0f;
    self.bgViewD.layer.cornerRadius = 5.0f;
    
    // Initialization code
}

-(void)setModel:(id)model {
    HCMineAnswerdData *data = (HCMineAnswerdData *)model;
    
    [self.headIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",data.pr_path]]];
    self.name.text = [NSString stringWithFormat:@"%@",data.pr_name];
    self.time.text = [NSString stringWithFormat:@"%@",data.pr_time];
    self.text.text = [NSString stringWithFormat:@"%@",data.pr_text];
    
    [self.headIMG_b sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",data.path]]];
    self.name_b.text = [NSString stringWithFormat:@"%@",data.name];
    self.time_b.text = [NSString stringWithFormat:@"%@",data.time];
    self.text_b.text = [NSString stringWithFormat:@"%@",data.text];
    
    if ([data.stat integerValue] == 0) {
        self.stateLabel.text = @"未采纳";
        self.stateLabel.textColor = [UIColor lightGrayColor];
    }else{
        self.stateLabel.textColor = YBKRGBCOLOR(241, 96, 96, 1);
        self.stateLabel.text = @"已采纳";
    }
    
    self.count.text = [NSString stringWithFormat:@"回答 %@",data.count];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
